#include<vector>
#include<string>
using namespace std;

int minimumDeleteSum(string s1, string s2) {
    int m = s1.size(), n = s2.size();
    int a = 0, b = 0;
    for (auto x : s1) a += x;
    for (auto x : s2) b += x;
    vector<vector<int>> dp(m + 1, vector<int>(n + 1));
    for (int i = 1; i <= m; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if (s1[i - 1] == s2[j - 1])
                dp[i][j] = max({ dp[i - 1][j - 1] + s1[i - 1], dp[i][j - 1], dp[i - 1][j], dp[i - 1][j - 1] });
            else dp[i][j] = max({ dp[i][j - 1], dp[i - 1][j], dp[i - 1][j - 1] });
        }
    }
    return a + b - 2 * dp[m][n];
}

int findLength(vector<int>& nums1, vector<int>& nums2) {
    int m = nums1.size(), n = nums2.size();
    vector<vector<int>> dp(m + 1, vector<int>(n + 1));
    int ret = 0;
    for (int i = 1; i <= m; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if (nums1[i - 1] == nums2[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1;
            else dp[i][j] = 0;
            ret = max(ret, dp[i][j]);
        }
    }
    return ret;
}

int main()
{
    minimumDeleteSum("sea", "eat");

	return 0;
}